package interfaces.menu.joinGame.filters;

import fileHandling.language.options.OptionValues;
import interfaces.menu.joinGame.gamesTable.GamesTableWidget;
import interfaces.options.ComboBoxOptionWidget;

public class GameModeFilter extends Filter {
	
	private ComboBoxOptionWidget comboBox;
	
	public GameModeFilter(ComboBoxOptionWidget filterWidget) {
		super(filterWidget);
		comboBox = filterWidget;
	}
	
	@Override
	public boolean passes(GamesTableWidget widget) {
		String value = comboBox.getValue();
		if(value.equals(OptionValues.Doesnt_Matter.toString())) return true;
		
		return value.equals(widget.getGameMode().getGameModeOptionValue().toString());
	}
}